<foreach name="tags" item="t">
    <a  id="tag" href="{:U('Index/tags',array('tid'=>$t['tid']))}">
        {$t['tname']}</a>
</foreach>
<style>
    a#tag{
        width: 60px;
        height: 25px;
        background-color: #7DD5D5;
        color: white;
        display: inline-block;
        text-align: center;
        padding-top: 3px;
        float: left;
        border-radius:3px;
        margin-right: 10px;
    }
</style>